package com.hhu.softpractise.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hhu.softpractise.common.DeleteRequest;
import com.hhu.softpractise.model.dto.post.PostDeleteRequest;
import com.hhu.softpractise.model.dto.post.PostQueryRequest;
import com.hhu.softpractise.model.entiy.Post;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hhu.softpractise.model.vo.PostVO;

import javax.servlet.http.HttpServletRequest;

/**
* @author 35534
* @description 针对表【post(帖子)】的数据库操作Service
* @createDate 2025-06-23 14:16:35
*/
public interface PostService extends IService<Post> {

    /**
     * 获取帖子封装
     *
     * @param post
     * @return
     */
    PostVO getPostVO(Post post);

    /**
     * 构造查询条件
     * @param postQueryRequest
     * @return
     */
    QueryWrapper<Post> getQueryWrapper(PostQueryRequest postQueryRequest);

    /**
     * 获取帖子封装列表
     *
     * @param postPage
     * @param request
     * @return
     */
    Page<PostVO> getPostVOPage(Page<Post> postPage, HttpServletRequest request);

    /**
     * 删除帖子，同时删除帖子下的评论，点赞收藏
     */
    void delete(PostDeleteRequest deleteRequest, HttpServletRequest request);
}
